{extend name="../../admin/view/main"}

{block name="button"}
<button data-title="表单字段" class='layui-btn layui-btn-sm layui-btn-primary messageconfig'>表单字段</button>
<!--{if auth("delete")}-->
<a data-confirm="确定要删除这些留言吗？" data-action='{:url("delete")}' data-rule="id#{key}" data-csrf="{:systoken('delete')}" class='layui-btn layui-btn-sm layui-btn-danger'>批量删除</a>
<!--{/if}-->
{/block}

{block name="content"}
<div class="layui-tab layui-tab-card think-bg-white">
    <div class="layui-tab-content think-box-shadow">
        {include file='message/index_search'}
        <table class="layui-table margin-top-10" lay-skin="line">
            {notempty name='list'}
            <thead>
            <tr>
                <th class='list-table-check-td think-checkbox'>
                    <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
                </th>
                <th class='text-left nowrap' width="120px">姓名</th>
                <th class='text-left nowrap' width="120px">电话</th>
                <th class='text-left nowrap' width="120px">邮箱</th>
                <th class='text-left nowrap'>标题</th>
                <th class='text-left nowrap'>状态</th>
                <th class='text-left nowrap'>IP</th>
                <th class='text-left nowrap'>添加时间</th>
                <th>操作</th>
            </tr>
            </thead>
            {/notempty}
            <tbody>
            {foreach $list as $key=>$vo}
            <tr data-dbclick>
                <td class='list-table-check-td think-checkbox'>
                    <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
                </td>
                <td class='text-left nowrap'>
                    {$vo.username}
                </td>
                <td class='text-left nowrap'>
                    {$vo.phone}
                </td>
                <td class='text-left nowrap'>
                    {$vo.email}
                </td>
                <td class='text-left nowrap'>
                    {$vo.title}
                </td>
                <td class='text-left nowrap'>
                    {if $vo.status eq 1}<span style="color: green">已审核</span>{else/}<span style="color: red">未审核</span>{/if}
                </td>
                <td class='text-left nowrap'>
                    {$vo.ip}
                </td>
                <td class='text-left nowrap'>
                    {$vo.create_at|format_datetime}
                </td>
                <td class='text-left nowrap'>
                    <!--{if auth("view")}-->
                    <a data-dbclick class="layui-btn layui-btn-sm" data-title="查看" data-modal='{:url("edit",["id"=>$vo.id])}'>查 看</a>
                    <!--{/if}-->
                    <!--{if auth("delete")}-->
                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要永久删除此评论吗？" data-action="{:url('delete')}" data-value="id#{$vo.id}" data-csrf="{:systoken('delete')}">删 除</a>
                    <!--{/if}-->
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
        {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
    </div>
</div>
{/block}

{block name='script'}
<script>
    layui.use(['layer', 'jquery', 'form'], function () {
        var layer = layui.layer,
            $ = layui.jquery,
            form = layui.form;
        $('.messageconfig').click(function(){
            $.msg.success('请移步到【自定义表单】菜单页面去配置');
        })
    });
</script>
{/block}